package org.choerodon.address.service;

import org.choerodon.address.domain.AreaVo;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

/**
 * @author jiu.yang@hand-china.com
 * @version 1.0
 * @description: TODO
 * @date 2021/11/24 8:36
 */
public interface AddressService {

    /**
     * 获取省市区地址原始信息
     *
     * @param request  请求
     * @param response 响应
     * @return
     * @throws ServletException exception description
     * @throws IOException      exception description
     * @version 1.0
     */
    String getAddressInfo(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;


    /**
     * 省市区地址初始化
     *
     * @param areaVo 地区数据
     * @return
     * @throws RuntimeException exception description
     * @version 1.0
     */
    AreaVo initialization(AreaVo areaVo);


    /**
     * 省市区地址持久化
     *
     * @param areaVo 地区数据
     * @return
     * @throws RuntimeException exception description
     * @version 1.0
     */
    List<AreaVo> save(AreaVo areaVo);


    /**
     * 查询下层子孙节点递归结构通过节点主键
     *
     * @param id 节点主建
     * @return
     * @throws RuntimeException exception description
     * @version 1.0
     */
    List<AreaVo> queryById(Long id);


    /**
     * 新增节点
     *
     * @param areaVo 节点主建
     * @return
     * @throws RuntimeException exception description
     * @version 1.0
     */
    Boolean add(AreaVo areaVo);


     /**
      * 删除节点
      *
      * @param areaVo 节点删除
      * @return
      * @version 1.0
      * @throws RuntimeException exception description
      */
     Boolean delete(AreaVo areaVo);
}
